package com.yiqi.zhiyuan.feature.order.view.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.suozhang.framework.utils.DateUtil;
import com.yiqi.zhiyuan.R;
import com.yiqi.zhiyuan.entity.enums.OrderState;
import com.yiqi.zhiyuan.entity.enums.OrderUseType;
import com.yiqi.zhiyuan.entity.vo.ChangeReasonVO;
import com.yiqi.zhiyuan.entity.vo.OrderVO;

import static com.suozhang.framework.utils.DateUtil.FORMAT_YYYY_MM_DD_HH_MM3;


/**
 * @ProjectName: ZhiYuan
 * @Description: java类作用描述
 * @Author: lijuwen
 * @CreateDate: 2019/3/15 10:07
 * @UpdateUser: 更新者
 * @UpdateDate: 2019/3/15 10:07
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class ReasonAdapter extends BaseQuickAdapter<ChangeReasonVO, BaseViewHolder> {

    private int mCheckPosition = -1;
    public ReasonAdapter() {
        super(R.layout.item_change_reason);
    }

    @Override
    protected void convert(BaseViewHolder helper, ChangeReasonVO item) {
        helper.setImageResource(R.id.iv_change_reason,mCheckPosition==helper.getAdapterPosition()?R.mipmap.ic_reason_checked:R.mipmap.ic_reason_uncheck)
        .setText(R.id.tv_change_reason,item.getValue());
    }


    public void checkState(int position) {
        this.mCheckPosition = position;
        notifyDataSetChanged();
    }
}
